package edu.esiag.isidis.fi.LBTest;


import edu.esiag.isidis.fi.lb.interfaces.INotifier;





public class InfoGenerator extends Thread{	
	private INotifier<Byte> mNotifier;
	public InfoGenerator(INotifier<Byte> pNotifier) {
		mNotifier = pNotifier;
		start();
	}
	
	
	@Override
	public void run() {
		int i = 0;
		while(true){
			try{
				int random = (int)(Math.random() * (300));
				Thread.sleep(random);
				mNotifier.notifier(new Byte((byte)((int)(Math.random()*(127)))));
				i++;
			}catch(Exception ex){
				ex.printStackTrace();
			}
		}
	}
}
